package cn.source.zk.domain.vo;

import cn.source.common.annotation.Excel;
import cn.source.common.annotation.Excels;
import cn.source.common.core.domain.entity.Customer;
import cn.source.zk.domain.entity.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class DeviceChannelVO {

    /**
     * 序号
     */
    private Long num;

    /**
     * 设备唯一标识
     */
    private String zhGuid;

    /**
     * 设备名称
     */
    @Excel(name = "设备名称")
    private String devName;

    /**
     * 设备编号
     */
    @Excel(name = "设备编号")
    private String devNum;

    /**
     * 设备状态
     */
    private String devStatus;

    /**
     * 设备描述
     */
    @Excel(name = "设备描述")
    private String devDesc;

    /**
     * 设备型号
     */
    private Long devModelNum;

    /**
     * 通道数量
     */
    private Integer channelSum;

    /**
     * 所属变电站
     */
    private Long substationNum;

    /**
     * sim卡
     */
    private Long simCardNum;

    /**
     * 所属客户
     */
    private Long customerNum;

    /**
     * 创建者
     */
    private String createBy;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新者
     */
    private String updateBy;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @Excels(
            @Excel(name = "所属变电站", targetAttr = "substationName", type = Excel.Type.EXPORT)
    )
    private Substation substation;


    private Customer customer;

    @Excels(
            @Excel(name = "设备类型", targetAttr = "name", type = Excel.Type.EXPORT)
    )
    private DevModel devModel;

    @Excels(
            @Excel(name = "sim卡", targetAttr = "phone", type = Excel.Type.EXPORT)
    )
    private SimCard simCard;

    @Excels(
            @Excel(name = "设备状态", targetAttr = "name", type = Excel.Type.EXPORT)
    )
    private DeviceStatus deviceStatus;

    @Excels(
            @Excel(name = "入网方式", targetAttr = "name", type = Excel.Type.EXPORT)
    )
    private ConnMethod connMethod;

    private List<Channel> channelList;

    /**
     * 数据源
     */
    @Excel(name = "数据源")
    private String devInfoSource;

    /**
     * 入网方式
     */

    private String connMode;

    /**
     * MAC地址
     */
    @Excel(name = "MAC地址")
    private String devMac;

    /**
     * 安装位置
     */
    @Excel(name = "安装位置")
    private String installationSite;

    /**
     * 投运日期
     */
    @Excel(name = "投运日期",dateFormat = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date putDate;

    /**
     * 存储间隔（分钟）
     */
    @Excel(name = "存储间隔（分钟）")
    private String storageInterval;

    private String communicationProtocolNum;

    private CommunicationProtocol communicationProtocol;

    private String communicationStatusNum;

    private String terminalIdentifier;

    private CommunicationStatus communicationStatus;

    @Excels({
            @Excel(name = "仪器号", targetAttr = "instrumentNum", type = Excel.Type.EXPORT),
            @Excel(name = "串口号", targetAttr = "serialPort", type = Excel.Type.EXPORT),
            @Excel(name = "波特率", targetAttr = "baudRate", type = Excel.Type.EXPORT),
            @Excel(name = "arm版本", targetAttr = "armVersion", type = Excel.Type.EXPORT),
            @Excel(name = "设备IP地址", targetAttr = "devIp", type = Excel.Type.EXPORT),
            @Excel(name = "设备端口号", targetAttr = "devPort", type = Excel.Type.EXPORT),
            @Excel(name = "后台IP地址", targetAttr = "backendIp", type = Excel.Type.EXPORT),
            @Excel(name = "后台端口号", targetAttr = "backendPort", type = Excel.Type.EXPORT),
            @Excel(name = "终端识别码", targetAttr = "terminalIdentifier", type = Excel.Type.EXPORT),
            @Excel(name = "波形点数", targetAttr = "wavePoint", type = Excel.Type.EXPORT),
            @Excel(name = "装置电源", targetAttr = "devicePowerSupply", type = Excel.Type.EXPORT),
            @Excel(name = "dsp版本", targetAttr = "dspVersion", type = Excel.Type.EXPORT),
            @Excel(name = "子网掩码", targetAttr = "devMask", type = Excel.Type.EXPORT),
            @Excel(name = "对时方式", targetAttr = "timeSyncMeth", type = Excel.Type.EXPORT),
            @Excel(name = "通讯是否加密", targetAttr = "communicationIsEncrypted", type = Excel.Type.EXPORT,readConverterExp = "0=是,1=否"),
            @Excel(name = "密钥", targetAttr = "key", type = Excel.Type.EXPORT),
            @Excel(name = "设备厂商", targetAttr = "devManufacturerName", type = Excel.Type.EXPORT),
            @Excel(name = "设备出场日期", targetAttr = "devProductionDate", type = Excel.Type.EXPORT,dateFormat = "yyyy-MM-dd"),
            @Excel(name = "维修时间", targetAttr = "maintainDate", type = Excel.Type.EXPORT,dateFormat = "yyyy-MM-dd"),
            @Excel(name = "下次维修时间", targetAttr = "nextMaintainDate", type = Excel.Type.EXPORT,dateFormat = "yyyy-MM-dd"),
    })
    private DeviceDetails deviceDetails;

    private Long sort;

}
